package com.jr.controller;

import com.jr.entry.Enterprise;
import com.jr.entry.Posts;
import com.jr.pojo.HighSalInformation;
import com.jr.service.EnterpriseService;

import com.jr.service.PostsService;
import com.jr.util.ResultObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.sound.midi.Soundbank;
import java.util.ArrayList;

@RestController
@RequestMapping("/po/")
public class PostsController {
    @Autowired
    private PostsService postsService;

    @Autowired
    private EnterpriseService enterpriseService;
    @Autowired
    private ResultObject result;

    /**
     *SelectHighSal 查找高薪的前十个企业
     * @return  result
     */
    @RequestMapping("SelectHighSal")
    public ResultObject SelectHighSal(){
        result.setStatus(400);
        result.setResult(postsService.selectHighSalInformation());
        return result;
    }

    /**
     * SelectByBusiness   通过企业名查找企业信息
     * @param enterprise   参数--企业名
     * @return   result
     */
    @RequestMapping("SelectByBusiness")
    public ResultObject SelectByBusiness(Enterprise enterprise){
        result.setStatus(400);
        result.setResult(enterpriseService.showEnterprise(enterprise));
        return result;
    }
    @RequestMapping("selectPostsByCid")
    public ResultObject selectPostsByCid(Posts posts){
        result.setResult(postsService.showPosts(posts));
        result.setStatus(400);
        return result;
    }



}
